package com.xc.service.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xc.mapper.Studentmapper;
import com.xc.pojo.Student;
import com.xc.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 星晨
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private Studentmapper studentmapper;

    @Override
    public PageInfo<Student> queryAllByPage(Integer pageNum, Integer pageSize) {
        //开启分页
        PageHelper.startPage(pageNum,pageSize);
        List<Student> students = studentmapper.queryAllByPage();
        PageInfo<Student> pageInfo = new PageInfo<>(students);
        return pageInfo;
    }
}
